Skip to content

Conversation

@A6GibKm
Copy link
Contributor

@A6GibKm A6GibKm commented Nov 27, 2025

Generated by temporarily adding glib:get-type to the gir file, moving he
generated file to src and modifying the glib::wrapper macro.

This is based on top of #2183.

impl RenderReplay {
#[doc(alias = "gsk_render_replay_default")]
#[allow(clippy::should_implement_trait)]
pub fn default(&mut self, node: impl AsRef<RenderNode>) -> Option<RenderNode> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think any of those need &mut self

@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 2 times, most recently from 13e5bfa to 31ed695 Compare November 27, 2025 16:35
@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 3 times, most recently from 8e972de to 3cec3c9 Compare November 27, 2025 20:43
}

#[doc(alias = "gsk_render_replay_set_node_foreach")]
pub fn set_node_foreach<P: Fn(&RenderReplay, &RenderNode) -> bool + 'static>(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pub fn set_node_foreach<P: Fn(&RenderReplay, &RenderNode) -> bool + 'static>(
pub fn set_node_foreach<P: Fn(&RenderReplay, &RenderNode) -> glib::ControlFlow + 'static>(

I think. The return value is whether to continue or break.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

 * gsk_render_replay_set_node_foreach:
 * @self: the replay
 * @foreach: (nullable): the function to call for all nodes
 * @user_data: user data to pass to @func
 * @user_destroy: destroy notify that will be called to release
 *   user_data
 *
 * Sets the function to call for every node.
 *
 * This function is called before the node filter, so if it returns
 * FALSE, the node filter will never be called.

I am not sure, but I left the code with ControlFlow for now.

Copy link
Member

@sdroege sdroege left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me apart from those details

@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 3 times, most recently from d52e5d8 to 7ed594f Compare November 28, 2025 09:09
Generated by temporarily adding glib:get-type to the gir file, moving the
generated file to src and then

- Replace the glib::wrapper macro with `struct` and `impl Drop`.
- Replace from_glib_borrow with Self(ptr)
- Replace to_glib_none_mut with self.0.as_mut
@A6GibKm A6GibKm force-pushed the render-replay-bindings branch 3 times, most recently from 834d30b to 360024c Compare November 28, 2025 10:07
@A6GibKm A6GibKm force-pushed the render-replay-bindings branch from 360024c to e32fbaa Compare November 28, 2025 10:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants